package com.ynu.springbootappdemo.model.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ynu.springbootappdemo.common.entity.BaseEntity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
/*
* 中间实体
* */
@Entity
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
public class CateGoods extends BaseEntity {
    @ManyToOne(fetch = FetchType.EAGER)
    @JsonIgnoreProperties(value = {"cateGoods"})
    private Goods goods;

    @ManyToOne(fetch = FetchType.EAGER)
    @JsonIgnoreProperties(value = {"cateGoods"})
    private Categories categories;
}
